<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.wpf.bean.Userbean" %>
<% String userName = (String)session.getAttribute("username"); %>
<% if(userName==null){ %>
	<jsp:forward page="/wpf_login.jsp"/>
<%}else{ %>
<!DOCTYPE html>
<html>
<head>
<title>修改学生信息</title>
<style>
<jsp:include page="./css/allStyle.css" flush="true" />
</style>
<script>
	function confirmUpdata() {
		if(confirm("你已登录！修改后需要重新登录！")){
			testForm.submit();
		}
	}
</script>
</head>
<body>
<jsp:useBean id="edituser" class="com.wpf.bean.Userbean" scope="session"/>
<h1>学生管理系统</h1>
<h4><font color="grey">编辑学生信息页面</font></h4>
<hr>
<table>
	<tr>
		<th class="va">
			<form action="wpf_RefreshData" method="post">
				<input class="back bot" type="submit" value="❌返回" />
			</form>
		</th>
		<th>编辑信息窗口</th>
	</tr>
	<tr>
		<td class="va">学号:</td>
		<td><font size="3" color="green"><strong><%=edituser.getId() %></strong></font></td>
	</tr>
	<form action="wpf_EditData?id=<%=edituser.getId() %>" method="post">
	<tr>
		<td class="va">姓名:</td>
		<td><input type="text" name="newusername" value="<%=edituser.getUsername() %>" /></td>
	</tr>
	<tr>
		<td class="va">新密码:</td>
		<td><input type="password" name="newpassword" /></td>
	</tr>
	<tr>
		<td class="va">确认密码:</td>
		<td><input type="password" name="compass" /></td>
	</tr>
	<tr>
		<td class="va">邮箱:</td>
		<td><input type="text" name="newemail" value="<%=edituser.getEmail() %>" /></td>
	</tr>
	<tr>
		<td class="va">出生日期:</td>
		<td><input type="date" name="newbirthday" class="wi" value="<%=edituser.getBirthday() %>" /></td>
	</tr>
	<tr class="ri">
		<td colspan="2">
			${EditMessage}
			<input class="reset bot" type="reset" value="✖重置" />
			<% if(userName.equals(edituser.getUsername())){ %>
				<input type="submit" onclick="return confirm('你已登录！修改后需要重新登录！')" value="✔更改" />
			<%}else{ %>
				<input class="confirm bot" type="submit" value="✔更改" />
			<%} %>
		</td>
	</tr>
	</form>
</table>
</body>
</html>
<%} %>
